setProvince();

function setProvince()
{
	Ts_areaInfo.getAreaClassByUpId('000000000000000',function(data){
		DWRUtil.removeAllOptions('province');
		DWRUtil.addOptions('province',{'':'请选择'});
		DWRUtil.addOptions('province',data);
	})
}
function setCitys(prov)
{
   var provence=prov;
	 Ts_areaInfo.getAreaClassByUpId(provence,function(data){
		DWRUtil.removeAllOptions('eparchy_code');
		DWRUtil.addOptions('eparchy_code',{'':'请选择'});
		DWRUtil.addOptions('eparchy_code',data);
		DWRUtil.removeAllOptions('city_code');
		DWRUtil.addOptions('city_code',{'':'请选择'});
	});
}

function setAreas(city_id){
	Ts_areaInfo.getAreaClassByUpId(city_id,function(data){
	 	DWRUtil.removeAllOptions('city_code');
     	DWRUtil.addOptions('city_code',{'':'请选择'});
	 	DWRUtil.addOptions('city_code',data);
	});
}





 
 //验证只能输入数字和小数点
function clearNoNum(obj){
	//先把非数字的都替换掉，除了数字和.
	obj.value = obj.value.replace(/[^\d.]/g,"");
	//必须保证第一个为数字而不是.
	obj.value = obj.value.replace(/^\./g,"");
	//保证只有出现一个.而没有多个.
	obj.value = obj.value.replace(/\.{2,}/g,".");
	//保证.只出现一次，而不能出现两次以上
	obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
}
// 检测是否为合法数据
function isNum(str) {
	return (str.search(/^\d+(\.\d+)?$/) != -1);
}
function trim(str){
    return str.replace(/(^\s*)|(\s*$)/g,"");
  }//去掉空格





//========================用户名验证start ===========================







function ifCheck(){
	
	if(document.getElementById("client_status5").checked == true){
		
		document.getElementById("client_status1").disabled=true;
		document.getElementById("client_status2").disabled=true;
		document.getElementById("client_status3").disabled=true;
		document.getElementById("client_status4").disabled=true;
	}else {
		
		document.getElementById("client_status1").disabled=false;
		document.getElementById("client_status2").disabled=false;
		document.getElementById("client_status3").disabled=false;
		document.getElementById("client_status4").disabled=false;
	}
}



//验证主营方向
function showSpan(val){
	if(val==1){
		document.getElementById('xiaoshou').style.display='block';
		document.getElementById('caigou').style.display='none';
	}
	if(val==0){
		document.getElementById('xiaoshou').style.display='none';
		document.getElementById('caigou').style.display='block';
	}
	if(val==2){
		document.getElementById('xiaoshou').style.display='block';
		document.getElementById('caigou').style.display='block';
	}
}




function choseForm(val)
{
	if(val == "custButton"){
	document.getElementById('custInfo').style.display='block';
	document.getElementById('userInfo').style.display='none';
	document.getElementById('levelInfo').style.display='none';
	}
	if(val == "userButton"){
	document.getElementById('custInfo').style.display='none';
	document.getElementById('userInfo').style.display='block';
	document.getElementById('levelInfo').style.display='none';
	}
	if(val == "levelButton"){
	document.getElementById('custInfo').style.display='none';
	document.getElementById('userInfo').style.display='none';
	document.getElementById('levelInfo').style.display='block';
	}	
}


 
 


 